<?php

class WxsourcedataController extends Controller
{
	/*
    * 获取列表分页
    *
    */
	public function actionGetListPaging()
	{

		try {
			//参数验证

			//检测
			$user_id = SessionService::getUserIDBySessionid();

			$wx_id = Util::getParamNotEmpty("wx_id");


			$searchsql = Util::initSearchSql();

			$searchsql = Util::getSerarchStrAdd($searchsql,"ToUserName",$wx_id);
			$searchsql = Util::getSerarchStr($searchsql,"MsgType","MsgType");


			//获取count
			$totalcount = WxSourceData::model()->count($searchsql);

            //排序
            $searchsql = $searchsql . " order by create_time desc";

            //加上分页控制
            $searchsql = Util::addLimitSql($searchsql);

            //获取list
            $list = WxSourceData::model()->findAll($searchsql);


            Util::responseList($totalcount, $list);

        } catch (Exception $e) {
			Util::responseErrorMsg($e->getMessage());

		}


	}
}